package com.ruoyi.medicine.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.medicine.mapper.HisMedicineFactoryMapper;
import com.ruoyi.medicine.domain.HisMedicineFactory;
import com.ruoyi.medicine.service.IHisMedicineFactoryService;

/**
 * 生产厂家信息Service业务层处理
 * 
 * @author ruoyi
 * @date 2024-09-04
 */
@Service
public class HisMedicineFactoryServiceImpl implements IHisMedicineFactoryService 
{
    @Autowired
    private HisMedicineFactoryMapper hisMedicineFactoryMapper;

    /**
     * 查询生产厂家信息
     * 
     * @param factoryId 生产厂家信息主键
     * @return 生产厂家信息
     */
    @Override
    public HisMedicineFactory selectHisMedicineFactoryByFactoryId(Long factoryId)
    {
        return hisMedicineFactoryMapper.selectHisMedicineFactoryByFactoryId(factoryId);
    }

    /**
     * 查询生产厂家信息列表
     * 
     * @param hisMedicineFactory 生产厂家信息
     * @return 生产厂家信息
     */
    @Override
    public List<HisMedicineFactory> selectHisMedicineFactoryList(HisMedicineFactory hisMedicineFactory)
    {
        return hisMedicineFactoryMapper.selectHisMedicineFactoryList(hisMedicineFactory);
    }



    /**
     * 新增生产厂家信息
     * 
     * @param hisMedicineFactory 生产厂家信息
     * @return 结果
     */
    @Override
    public int insertHisMedicineFactory(HisMedicineFactory hisMedicineFactory)
    {
        hisMedicineFactory.setCreateTime(DateUtils.getNowDate());
        return hisMedicineFactoryMapper.insertHisMedicineFactory(hisMedicineFactory);
    }

    /**
     * 修改生产厂家信息
     * 
     * @param hisMedicineFactory 生产厂家信息
     * @return 结果
     */
    @Override
    public int updateHisMedicineFactory(HisMedicineFactory hisMedicineFactory)
    {
        hisMedicineFactory.setUpdateTime(DateUtils.getNowDate());
        return hisMedicineFactoryMapper.updateHisMedicineFactory(hisMedicineFactory);
    }

    /**
     * 批量删除生产厂家信息
     * 
     * @param factoryIds 需要删除的生产厂家信息主键
     * @return 结果
     */
    @Override
    public int deleteHisMedicineFactoryByFactoryIds(Long[] factoryIds)
    {
        return hisMedicineFactoryMapper.deleteHisMedicineFactoryByFactoryIds(factoryIds);
    }

    /**
     * 删除生产厂家信息信息
     * 
     * @param factoryId 生产厂家信息主键
     * @return 结果
     */
    @Override
    public int deleteHisMedicineFactoryByFactoryId(Long factoryId)
    {
        return hisMedicineFactoryMapper.deleteHisMedicineFactoryByFactoryId(factoryId);
    }
}
